package com.sxt.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sxt.sys.domain.Reply;
import com.sxt.sys.mapper.ReplyMapper;
import com.sxt.sys.service.ReplyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sxt.sys.vo.ReplyVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cr
 * @since 2019-04-29
 */
@Service
public class ReplyServiceImpl extends ServiceImpl<ReplyMapper, Reply> implements ReplyService {
    @Autowired
    private ReplyMapper replyMapper;
    @Override
    public Integer insert(ReplyVo replyVo) {
        return replyMapper.insert(replyVo);
    }

    @Override
    public List<ReplyVo> queryAll(Integer topicid) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("topicid",1);
        return replyMapper.selectList(queryWrapper);
    }
}
